1 Download R

2 Download RStudio

  • R Studio is an integrated development environment, built upon the base R
  • Download RStudio


3 Open RStudio

3.1 Install library packages needed for wordcloud app

  1. In RStudio console window type the following commands one-at-a-time, followed by the enter key
    the > prompt will appear when process is complete:
  • install.packages(“shiny”)
  • install.packages(“tm”)
  • install.packages(“wordcloud”)
  • install.packages(“memoise”)
Image Caption: Install packages

Image Caption: Install packages



4 Use Wordcloud app

4.1 Open all 3 RShiny app files in RStudio:

  • global.R
  • ui.R
  • server.R
Image Caption: Open files

Image Caption: Open files


4.1.1 All 3 Files opened in RStudio

Image Caption: Opened files

Image Caption: Opened files



4.2 Run the Shiny App

4.2.1 click Run App button

  • located at top right corner of code window
  • doesn’t matter which of the 3 app files are currently in active window
Image Caption: Click Run App button

Image Caption: Click Run App button


4.2.1.1 Processing

  • The app will open in a RStudio pop-up window
  • Running app shows ‘Processing corpus’ at bottom of screen
Image Caption: Processing messages in console window

Image Caption: Processing messages in console window


4.2.1.2 Console running messages

  • text will be running in RStudio Console window as it is processed
    including some warnings that all words will not fit on page
    and will not be plotted (if too many words)
Image Caption: Run app

Image Caption: Run app


4.2.1.3 Waiting for the finished wordcloud

Image Caption: Waiting for Wordcloud to Finish

Image Caption: Waiting for Wordcloud to Finish


4.2.2 Finished wordcloud results

Image Caption: Finished Wordcloud

Image Caption: Finished Wordcloud



4.3 Change sliders for frequency and maximum words

  • to interactively Adjust Size of Wordcloud
  • Frequency: is the number of times a word appears in document
  • Max words: the larger this value is, the longer the process takes,
    more words will be included in word cloud, though limited by plot window size

4.3.1 Increasing minimum frequency shows less words

Image Caption: Change Sliders

Image Caption: Change Sliders


4.3.2 Maximum words 235 makes a smaller word cloud

Image Caption: Maximum words 235

Image Caption: Maximum words 235


4.3.2.1 Waiting for maximum word count (7000) takes some time to run

Image Caption: Waiting for maximum word count

Image Caption: Waiting for maximum word count


4.3.3 Maximum words 7000

Image Caption: Maximum words 7000

Image Caption: Maximum words 7000



4.4 Choose a different text from drop-down options

Image Caption: Choose a different text

Image Caption: Choose a different text


4.5 Click change text button

Image Caption: 'Change text button'

Image Caption: ‘Change text button’



5 Open Shiny app in a browser window

The app will only continue run while the app pop-up window is still open in RStudio
if app appears greyed out from disuse, try refreshing browser page to reactivate

Image Caption: Open Shiny app in browser

Image Caption: Open Shiny app in browser



6 Save word cloud image to computer as .png

  • Right-click word cloud image to find save options
  • (Note: this image is from a MacOS)
Image Caption: Right-click to save image to computer

Image Caption: Right-click to save image to computer


Image Caption: Save image to computer

Image Caption: Save image to computer


Image Caption: Rename image file

Image Caption: Rename image file



7 Customize app

7.1 Add a different text file to the global.R file

  1. For ease the first time adding new text to analyze, relevant text can just be added and saved to the newtext.txt file
  2. To upload a new text file, the file name must be added to the global.R file
    following the same format as previous entries:
    2.1. the first term shows in drop-down choice box,
    2.2. the second term is the name of the file which must be included in same folder as all app files
    2.3. note that text is enclosed with quotation marks, and each line must end with a comma except the last line
Image Caption: Add new text files

Image Caption: Add new text files


7.2 Add words to exclude from text analysis to the global.R file

  • add word list, each separated by commas
Image Caption: List of words to exclude

Image Caption: List of words to exclude


7.3 Change default values for slider input in ui.R file

Image Caption: Changing default values

Image Caption: Changing default values



8 Sources: